<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Illo error qui natus cum facilis, minima delectus
        laborum quisquam, fuga dignissimos sit dolorem fugit assumenda aut rem porro ipsum corporis quod!</p>
        <script>
            /* var arr = [{id:1001,name:"html"},{id:1002,name:"css"}];
            var id = 1002;

            arr.forEach(item=>{
                if(item.id == id){

                }
            }) */
            var arr = [{price:1,name:"html"},{id:1002,name:"css"}];
            var sum = arr.filter(item=>item.state)
            console.log(sum);
            var res = sum.reduce((a,b)=>{
                return 
            })


        </script>
</body>
</html>